﻿// ---------------------------------------------------------------------
// partial của APIManager
//
// Nội dung:
//    + Các hàm API xử lý đến player
//
// Copyright (c) 2009 YugiOH 
//
// Nguyễn Hữu Lê Trọng Tín      YM: ilu2009             ĐT: 0906520611
// Võ Phước Hậu                 YM : phuochauspkt       ĐT: 0979202707
// ---------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ServerYuGi;
using Yugi.Client.Card;
using ServerYuGi.Block;

namespace APIEffect
{
    public partial class APIManager
    {
        /// <summary>
        /// Tăng điểm cho player
        /// </summary>
        /// <param name="ID">ID Player</param>
        /// <param name="DiemCong">Điểm Cộng</param>
        public void PLAYER_Health_Increase(int ID, int DiemCong)
        {
            APIPlayer.PLAYER_Health_Increase(ID, DiemCong);
        }

        /// <summary>
        /// Giảm điểm của player
        /// </summary>
        /// <param name="ID">ID Player</param>
        /// <param name="DiemGiam">Điểm Giảm</param>
        public void PLAYER_Health_Decrease(int ID, int DiemGiam)
        {
            APIPlayer.PLAYER_Health_Decrease(ID, DiemGiam);
        }

        /// <summary>
        /// Lấy player tấn công trong lượt BattlePhase
        /// </summary>
        /// <returns>ID Player tấn công</returns>
        public int PLAYER_BF_GetAttacker()
        {
           return APIPlayer.PLAYER_BF_GetAttacker();
        }

        /// <summary>
        /// Lấy player phòng thủ trong lượt BattlePhase
        /// </summary>
        /// <returns>ID player phòng thủ</returns>
        public int PLAYER_BF_GetDefender()
        {
            return APIPlayer.PLAYER_BF_GetDefender();
        }

        /// <summary>
        /// Lay Current Effect Checker
        /// </summary>
        /// <returns></returns>
        public int PLAYER_GetCurrentChecker()
        {
            return APIPlayer.PLAYER_GetCurrentChecker();
        }

        /// <summary>
        /// Lay Player khac voi Player duoc truyen vo
        /// </summary>
        /// <param name="player_id"></param>
        /// <returns></returns>
        public int PLAYER_GetAnotherPlayer(int player_id)
        {
            return APIPlayer.PLAYER_GetAnotherPlayer(player_id);
        }

        /// <summary>
        /// Lay Diem Goc cua Player
        /// </summary>
        /// <param name="id">id player</param>
        /// <returns>Diem goc</returns>
        public int PLAYER_GetHealth(int id)
        {
            return APIPlayer.PLAYER_GetHealth(id);
        }

        /// <summary>
        /// Tra ve List Bai Tren Tay
        /// </summary>
        /// <param name="player_id">ID Player</param>
        /// <returns>List bài trên tay</returns>
        public List<SCard> PLAYER_Get_ListCard_Hand(int player_id)
        {
            return APIPlayer.PLAYER_Get_ListCard_Hand(player_id);
        }

        /// <summary>
        /// Trả về List bài trên bàn
        /// </summary>
        /// <param name="player_id">id player</param>
        /// <returns>List bài trên bàn</returns>
        public List<SCard> PLAYER_Get_ListCard_Table(int player_id)
        {
            return APIPlayer.PLAYER_Get_ListCard_Table(player_id);
        }

        /// <summary>
        /// Trả về List bài trên bàn
        /// </summary>
        /// <param name="player_id">id player</param>
        /// <returns>List bài trên bàn</returns>
        public List<SCard> PLAYER_Get_ListCard_Deck(int player_id)
        {
            return APIPlayer.PLAYER_Get_ListCard_Deck(player_id);
        }

        /// <summary>
        /// Tra ve List Bai Trong Mo
        /// </summary>
        /// <param name="player_id">id player</param>
        /// <returns>List Bai Tren Ban</returns>
        public List<SCard> PLAYER_Get_ListCard_Graveyard(int player_id)
        {
            return APIPlayer.PLAYER_Get_ListCard_Graveyard(player_id);
        }

        /// <summary>
        /// Tra ve So Bai Monster Tren Ban
        /// </summary>
        /// <param name="player_id">id player</param>
        /// <returns>So Bai Monster Tren Ban</returns>
        public int PLAYER_GetNumberMonster_Table(int player_id)
        {
            return APIPlayer.PLAYER_GetNumberMonster_Table(player_id);
        }

        /// <summary>
        /// Tra ve So Bai Spell/Trap Tren Ban
        /// </summary>
        /// <param name="player_id">id player</param>
        /// <returns>So Bai Spell/Trap Tren Ban</returns>
        public int PLAYER_GetNumberSpellTrap_Table(int player_id)
        {
            return APIPlayer.PLAYER_GetNumberSpellTrap_Table(player_id);
        }

        /// <summary>
        /// Lay Bai Co ID Tu Nguoi Choi
        /// </summary>
        /// <param name="player_id">ID Nguoi So Huu</param>
        /// <param name="id">ID la bai</param>
        /// <returns>Tra Ve La bai, null neu ko tim thay</returns>
        public YBaseCard PLAYER_Find_Card(int player_id,int id)
        {
            return APIPlayer.PLAYER_Find_Card(player_id, id);
        }

        public void PLAYER_Draw_Card(int player_id)
        {
            APIPlayer.PLAYER_Draw_Card(player_id);
        }

        public void PLAYER_Discard_Card(int player_id,int id)
        {
            APIPlayer.PLAYER_Discard_Card(player_id, id);
        }

        public void PlAYER_ChangeControl_Card_Table2Table(int idplayer,int idCard)
        {
            APIPlayer.PlAYER_ChangeControl_Card_Table2Table(idplayer, idCard);
        }

        //  [4/22/2010 TinNguyen]
        //-------------------------Block-------------------------------
        public BlockData PLAYER_Get_Block(int idplayer)
        {
            return APIPlayer.PLAYER_Get_Block(idplayer);
        }
        public void PLAYER_Update_NormalSummon(int idplayer,bool value)
        {
            APIPlayer.PLAYER_Update_NormalSummon(idplayer, value);
        }
        public void PLAYER_Update_AllowMonsterActive(int idplayer, bool value)
        {
            APIPlayer.PLAYER_Update_AllowMonsterActive(idplayer, value);
        }
    }
}
